package wechat.custapp

import wechat.base.snd.WCApplication

class WXCorpCustAppFactory {
	private static WCCorpCustApplication customerApp = null;
	def static getDefaultCorpApp(){
		if (customerApp==null){
			customerApp = new WCCorpCustApplication('wx59b4783059880985','6YC23FwHm6-pEArDeGFGL2w6jNYddWitbT8o28VnOeU','1000002') //yunduo customer
//			val propertyReader  = new PropertyReader()
//			customerApp = new WCApplication(propertyReader.corpId,propertyReader.SECRET,propertyReader.AGENTID) //yunduo
		}
		customerApp
	}
	def static createCorpCustApp(String corp_id, String secret, String agent_id){
		if (customerApp==null){
			customerApp = new WCCorpCustApplication(corp_id, secret, agent_id)
		}
		customerApp
	}
	def static forceNewCorpCustApp(String corp_id, String secret, String agent_id){
		customerApp = new WCCorpCustApplication(corp_id, secret, agent_id)
		customerApp
	}	
}

class WCCorpCustApplication extends WCApplication{
	new (String corp_id, String secret, String agent_id){
		super(corp_id,secret,agent_id)
	}	
}
